#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.8.1
 Author:         James Chen

 Script Function:
	Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

Opt("WinWaitDelay", 100)
Opt("WinDetectHiddenText", 1)
Opt("MouseCoordMode", 2)

;-------------------------------------------------------------------------------

$Clicker = False

$TimeoutTime = 1

$Coord = ' '

$ButtonColor = 0xFFEC57

HotKeySet("^{ENTER}", "end")
HotKeySet("^{`}", "ActivateClicker")

;-------------------------------------------------------------------------------

_WinWaitActivate("Command and Conquer (378171) (378158) (378158)(GAMEDATAGENERATOR) (WebGL) - Google Chrome","")


While True

	If $Clicker Then

		_WinWaitActivate("Command and Conquer (378171) (378158) (378158)(GAMEDATAGENERATOR) (WebGL) - Google Chrome","")

		$Coord = PixelSearch(473, 218, 1480, 895, $ButtonColor, 2)

		If Not @error Then

			MouseClick("left",$Coord[0], $Coord[1],1)
			Sleep(1500)

		EndIf

		MouseMove(1548, 495, 1)
		MouseMove(1548, 496, 1)

	EndIf

WEnd

Func ActivateClicker()

	If $Clicker Then
		$Clicker = False
		MsgBox(0, "Clicker", "Off", $TimeoutTime)
	Else
		$Clicker = True
		MsgBox(0, "Clicker", "On", $TimeoutTime)
	EndIf

EndFunc

Func end()
	Exit
EndFunc   ;==>end

Func _WinWaitActivate($title, $text, $timeout = 0)
	WinWait($title, $text, $timeout)
	If Not WinActive($title, $text) Then WinActivate($title, $text)
	WinWaitActive($title, $text, $timeout)
EndFunc   ;==>_WinWaitActivate